<!doctype html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>Read-only events</title>
</head>
	<script src="../../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="../../codebase/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
	
	<script src="../../codebase/ext/dhtmlxscheduler_readonly.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css" media="screen">
	html, body{
		margin:0px;
		padding:0px;
		height:100%;
		overflow:hidden;
	}	
</style>

<script type="text/javascript" charset="utf-8">
	function init() {
		
		scheduler.config.xml_date="%Y-%m-%d %H:%i";
		scheduler.config.api_date="%Y-%m-%d %H:%i";
		scheduler.config.details_on_dblclick = true;
		scheduler.init('scheduler_here',new Date(2009,10,1),"month");
		
		
		function block_readonly(id){
			if (!id) return true;
			return !this.getEvent(id).readonly;
		}
		scheduler.attachEvent("onBeforeDrag",block_readonly)
		scheduler.attachEvent("onClick",block_readonly)

		scheduler.addEvent({
			id:1,
			start_date:"2009-11-5",
			end_date:"2009-11-15",
			text:"editable (dbl-click)"
		});
		
		scheduler.addEvent({
			id:2,
			start_date:"2009-11-20",
			end_date:"2009-11-25",
			text:"readonly (dbl-click)",
			readonly:true
		});
		
		scheduler.showLightbox("2");
	}
</script>

<body onload="init();">
	<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
		<div class="dhx_cal_navline">
			<div class="dhx_cal_prev_button">&nbsp;</div>
			<div class="dhx_cal_next_button">&nbsp;</div>
			<div class="dhx_cal_today_button"></div>
			<div class="dhx_cal_date"></div>
			<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
			<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
			<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
		</div>
		<div class="dhx_cal_header">
		</div>
		<div class="dhx_cal_data">
		</div>		
	</div>
</body>